package com.sip.stream.utils.zfy;

import com.google.gson.annotations.SerializedName;

public class GSConfigBean {
    @SerializedName("key")
    private String key;
    @SerializedName("name")
    private String name;
    @SerializedName("pattern")
    private String pattern;
    @SerializedName("selections")
    private String[] selections;
    @SerializedName("type")
    private String type;
    @SerializedName("value")
    private String value;

    public GSConfigBean(String key) {
        this.key = key;
    }

    public GSConfigBean() {
    }

    public static class Builder {
        private GSConfigBean target;

        public Builder(String key) {
            GSConfigBean gSConfigBean = new GSConfigBean(key);
            this.target = gSConfigBean;
            gSConfigBean.type = "edittext";
        }

        public Builder setName(String name) {
            this.target.setName(name);
            return this;
        }

        public Builder setType(String type) {
            this.target.setType(type);
            return this;
        }

        public Builder setValue(String value) {
            this.target.setValue(value);
            return this;
        }

        public Builder setBooleanValue(boolean status) {
            this.target.setValue(status ? "true" : "false");
            return this;
        }

        public Builder setPattern(String pattern) {
            this.target.setPattern(pattern);
            return this;
        }

        public Builder setSelections(String[] strArr) {
            this.target.setSelections(strArr);
            return this;
        }

        public GSConfigBean build() {
            return this.target;
        }
    }

    public String getType() {
        return this.type;
    }

    public GSConfigBean setType(String type) {
        this.type = type;
        return this;
    }

    public String getValue() {
        return this.value;
    }

    public boolean getBooleanValue() {
        return "true".equalsIgnoreCase(this.value);
    }

    public int getIntegerValue(int i) {
        try {
            return Integer.parseInt(this.value);
        } catch (Exception unused) {
            return i;
        }
    }

    public void setValue(String value) {
        this.value = value;
    }

    public String getKey() {
        return this.key;
    }

    public void setKey(String key) {
        this.key = key;
    }

    public String getName() {
        return this.name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String[] getSelections() {
        return this.selections;
    }

    public void setSelections(String[] selections) {
        this.selections = selections;
    }

    public String getPattern() {
        return this.pattern;
    }

    public void setPattern(String pattern) {
        this.pattern = pattern;
    }
}
